﻿namespace SharpF2.ModelView
{
	using System;
	using System.Windows.Input;
	using Commands;

	public class ReportErrorDialogModelView : ViewModelBase
	{
		#region Constructors

		public ReportErrorDialogModelView(String message)
		{
			SendError = false;
			ErrorExceptionStack = message;
		}

		#endregion

		#region Private Attributes

		private DelegateCommand reportErrorCommand;

		#endregion

		#region Public Properties

		public String ErrorExceptionStack { get; private set; }

		public ICommand ReportErrorCommand
		{
			get
			{
				if (null == reportErrorCommand)
					reportErrorCommand = new DelegateCommand(ExecuteReportErrorCommand);
				return reportErrorCommand;
			}
		}

		public Boolean SendError { get; private set; }

		#endregion

		#region Private Members

		private void ExecuteReportErrorCommand()
		{
			SendError = true;
			OnPropertyChanged("SendError");
		}

		#endregion
	}
}